package com.shang.controller.center;

import com.shang.pojo.Users;
import com.shang.service.center.CenterUserService;
import com.shang.utils.ShangJSONResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "center-用户中心",tags = {"用户中心展示的相关接口"})
@RestController
@RequestMapping("center")
public class CenterController {

    @Autowired
    private CenterUserService centerUserService;

    @ApiOperation(value = "获取用户信息")
    @GetMapping(value = "userInfo")
    public ShangJSONResult userInfo(String userId){
        Users users = centerUserService.queryUserInfo(userId);
        return ShangJSONResult.ok(users);
    }
}
